import { http, HttpResp } from "./global.ts";
import {MessageType} from "./common.ts";


export interface ConversationContent {
    type: MessageType;
    content: string;
}

export interface ConversationPayload {
    conversationId: string;
    conversationType: string;
    chatType: string;
    title: string;
    messages: ConversationContent[];
}


export function chat(conversationId: string,conversationType:string, chatType: string, message: string) {
    return http.get<string, HttpResp<string>>("/chat/conversationV1", {
        params: { conversationId: conversationId,conversationType: conversationType,chatType: chatType, message: message },
    });
}